<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改用户账户信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-acctinfo-edit" th:object="${aAcctInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户名：</label>
                <div class="col-sm-8">
                    <select name="userName" class="form-control m-b" id="ele">

                    </select>

                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">ETC 账户名：</label>
                <div class="col-sm-8">
                    <input name="accerName" th:field="*{accerName}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">ETC 账户号：</label>
                <div class="col-sm-8">
                    <input name="acctId" th:field="*{acctId}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">订单号：</label>
                <div class="col-sm-8">
                    <input name="orderId" th:field="*{orderId}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">手机号：</label>
                <div class="col-sm-8">
                    <input name="phone" th:field="*{phone}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">车架号：</label>
                <div class="col-sm-8">
                    <input name="vin" th:field="*{vin}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">车牌号：</label>
                <div class="col-sm-8">
                    <input name="plateNo" th:field="*{plateNo}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">秘钥：</label>
                <div class="col-sm-8">
                    <input name="accerKey" th:field="*{accerKey}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">SN号：</label>
                <div class="col-sm-8">
                    <input name="obuSn" th:field="*{obuSn}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">卡号：</label>
                <div class="col-sm-8">
                    <input name="icNumber" th:field="*{icNumber}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">银行id：</label>
                <div class="col-sm-8">
                    <input name="beanId" th:field="*{beanId}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">预开户主键ID：</label>
                <div class="col-sm-8">
                    <input name="preDataId" th:field="*{preDataId}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">工行e钱包账户号：</label>
                <div class="col-sm-8">
                    <input name="ebagNo" th:field="*{ebagNo}" class="form-control"  type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">ETC状态：</label>
                <div class="col-sm-8">
                    <select name="accerStatus" class="form-control m-b">
                        <option value="7"> ETC申请-审核通过</option>
                        <option value="6">ETC申请-审核不通过</option>
                    </select>

                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否删除：</label>
                <div class="col-sm-8">
                    <select name="isDelete" class="form-control m-b">
                        <option value="1">删除</option>
                        <option value="0">不删除</option>
                    </select>

                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "acctinfo/acctinfo";
        $("#form-acctinfo-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-acctinfo-edit').serialize());
            }
        }
        $(function(){
            func();
        });
        function func() {
            $.ajax({
                type: "POST",
                url: "/third-system-service/acctinfo/acctinfo/userlist",
                success: function (data) {

                    var vaule = data.total;

                    if (vaule > 0) {
                        datas = data.rows;

                        var optionstring = "";
                        for (var j = 0; j < datas.length; j++) {
                            console.log(datas[j].userName);
                            optionstring += "<option value=\"" + datas[j].userName + "\" >" + datas[j].userName + "</option>";
                        }

                        $("#ele").html(optionstring);
                    } else {
                        alert("暂无文件选择，请先上传文件！")

                        $("#ele").html("<option value=''>暂无</option>");

                    }
                }
            });
        }
    </script>
</body>
</html>